<template>
  <div id="app">
    <button @click="isShowB = !isShowB">
      {{ isShowB ? '隐藏ComponentB' : '显示Component B'}}
    </button>
    <ComponentA :showB="isShowB" />
  </div>
</template>

<script setup>
import ComponentA from './components/ComponentA.vue'
import {ref} from 'vue'
const isShowB = ref(true)
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  padding-top: 20px;
}

button {
  font-size: 16px;
  color: #fff;
  background-color: #42b983;
  border: none;
  border-radius: 5px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s;
  margin-bottom: 20px;
}

button:hover {
  background-color: #369f75;
}
</style>
